A disk drive typically includes a head-disk assembly (HDA) with a transducer and a disk, a buffer for temporarily storing data and a controller for controlling data transfer operations between the disk and an external system such as a host computer. The data is stored in substantially concentric tracks on the disk. During disk drive operation, the disk is rotated about an axis by a spindle motor while the transducer reads from and writes to a target track on the disk. A servo control loop uses servo data read from the disk to position the transducer above the target track while the data transfer occurs.
A single physical data stream is typically transferred between the HDA and the controller during read and write operations. The physical data stream includes a logical data stream (such as a file) sequentially followed by another logical data stream, sequentially followed by another logical data stream and so on. Thus, the physical data stream is a serial bit stream and the logical data streams are in sequence. However, for audio/video (A/V) streaming, it is desirable to divide the physical data stream into multiple interleaved logical data streams of related content which are accessed continuously and appear to be accessed in parallel.
The host computer is the consumer process and the disk is the source process during a read operation as data is transferred from the disk to the host computer, and the disk is the consumer process and the host computer is the source process during a write operation as data is transferred from the host computer to the disk. Typically, the buffer is loaded with data and is refilled with more data when the data is withdrawn by the consumer process so that data is continuously available for the consumer process. Buffer starvation occurs when the buffer does not contain data needed by the consumer process. For example, if the disk drive takes too long to transfer data from the disk to the buffer, then the host computer may empty the buffer of data yet still require more data. In A/V applications, in which the host computer requires real-time display of the A/V data, if the A/V data is not available from the disk drive in time then the host computer displays a still image instead of a moving image (an undesirable result).
The disk drive can include a cipher engine for encrypting data before storage to the disk and decrypting data after retrieval from the disk. The cipher engine encrypts and decrypts only one logical data stream at a time because cipher algorithms are generally applied on a per-stream basis. Therefore, simultaneous streaming applications such as A/V streaming require the disk drive to contain multiple cipher engines to provide separate cipher processing for the interleaved logical data streams. However, multiple cipher engines require expensive duplicate hardware, can simultaneously process only as many logical data streams as corresponding cipher engines, and are wasteful when simultaneous streaming is unnecessary.
There is, therefore, a need for a high speed, flexible cipher system for a disk drive that provides cost-effective encryption/decryption for a substantially unlimited number of logical data streams.